<?php
class statistics_model extends CI_Model {
	public function __construct() {
		parent::__construct ();
		$this->db = $this->load->database ( 'default', true );
	}
	public function query_statistics_info($id) {
		$id = $this->db->escape_str ( $id );
		$sql = "select * from  website_statistics where record_id ='$id' limit 1 ";
		$query = $this->db->query ( $sql );
		if ($query->num_rows ()) {
			return $query->row_array ();
		}
	}
	public function update_statistics($statistics, $id) {
		$this->db->where ( "record_id", $id );
		$this->db->update ( "website_statistics", $statistics );
	}
}

